<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script>
        function show() {
          var username =
                  document.getElementsByTagName("input")[0].value;
                  //document.getElementsByName("uname")[0].value;
                  //document.getElementById("uname").value;
                  // document.myform.uname.value;
                  //document.forms["myform"]["uname"].value;
            alert(username)
        }
    </script>
</head>
<body>
<a href="check3.html">下一步，验证</a>
<form action="" name="myform">
    <input type="text" name="uname" id="uname" value="请输入用户名" />
    <input type="submit"/>
</form>
<button onclick="show()">显示文本框内容</button>
</body>
</html>